#ifndef _SOMB_COMMON_H_
#define _SOMB_COMMON_H_


#define SOMB_DAEMON_PATH     "/var/run/somb"
#define SOMB_DAEMON_FILE     "somb_daemon.socket"
#define SOMB_DAEMON_ADDR     SOMB_DAEMON_PATH"/"SOMB_DAEMON_FILE

#define SOMB_CTRL_FILE     "somb_ctrl.socket"
#define SOMB_CTRL_ADDR       SOMB_DAEMON_PATH"/"SOMB_CTRL_FILE
#define SOMB_DAEMON_CONFIG   SOMB_DAEMON_PATH"/somb.conf"

#define SOMB_SUB_NS_ADDR_FMT0     (SOMB_DAEMON_PATH"/%d-%s-0.sock") /*pid-processname-0.sock*/
#define SOMB_SUB_NS_ADDR_FMT1     (SOMB_DAEMON_PATH"/%d-subns-1.sock") /*subnsid-subns-1.sock*/
#define SOMB_SUB_NS_ADDR_FMT2     (SOMB_DAEMON_PATH"/%d-subns-2-%d.sock") /*subnsid-subns-2-pid.socket*/

#define SOMB_ADDR_LEN    (100)
#define SOMB_MSG_MAX_LENGTH       (4096)
#define SOMB_DAEMON_MSG_HEADER_SIZE   (8)

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

#define SOMB_SERVICE_LISTENER_NUM_MAX  256 
typedef enum
{
    SOMB_SERVICE_STATUS_INVALID,
    SOMB_SERVICE_STATUS_READY,
    SOMB_SERVICE_STATUS_OFFLINE,
}E_SOMB_SERVICEID_STATUS;

typedef enum
{
  SOMB_DAEMON_NS_STATUS_INVALID,
  SOMB_DAEMON_NS_STATUS_ONLINE,
  SOMB_DAEMON_NS_STATUS_OFFLINE,
}SOMB_DAEMON_NS_STATUS;

enum
{
    SOMB_MSG_TYPE_INVALID,
    SOMB_MSG_TYPE_METHOD_REQUEST_SYNC,
    SOMB_MSG_TYPE_METHOD_RESPONSE_SYNC,
    SOMB_MSG_TYPE_METHOD_REQUEST_ASYNC,
    SOMB_MSG_TYPE_METHOD_RESPONSE_ASYNC,
    SOMB_MSG_TYPE_METHOD_SETREQUEST,
    SOMB_MSG_TYPE_EVENT,
    SOMB_MSG_TYPE_MAX,
};
#endif //_SOMB_COMMON_H_
